/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fi.uba.algo3.tp3.utils.dijkstra;

import java.util.ArrayList;
import fi.uba.algo3.tp3.utils.Punto;

/**
 *
 * @author Ezequiel
 */
public class Vertice implements Comparable<Vertice> {

    private Punto point;
    private ArrayList<Camino> adjacencias;
    private double distanciaMinima = Double.POSITIVE_INFINITY;
    private Vertice previo;

    public Vertice(int x, int y) {
        point = new Punto(x, y);
        adjacencias = new ArrayList<Camino>();
    }

    public Vertice(Punto p) {
        point = p;
        adjacencias = new ArrayList<Camino>();
    }

    @Override
    public String toString() {
        return point.getX() + ";" + point.getY();
    }

    public int compareTo(Vertice other) {
        return Double.compare(distanciaMinima, other.distanciaMinima);
    }

    public void setDistanciaMinima(double minDistance) {
        this.distanciaMinima = minDistance;
    }

    public void setPrevio(Vertice previous) {
        this.previo = previous;
    }

    public void agregarCamino (Camino e) {
        this.adjacencias.add(e);
    }

    public ArrayList<Camino> getCaminos() {
        return this.adjacencias;
    }

    public Punto getPunto() {
        return point;
    }

    public Vertice getPrevio() {
        return previo;
    }

    public double getDistanciaMinima() {
        return distanciaMinima;
    }

    

}
